import React, { Component } from 'react';
import "./search.css"
import { withRouter } from 'react-router-dom'



class index extends Component{
    toSearch(){
        this.props.history.push('/searchbox');
    }

    render() {
        return (
            <div className='search'>
                <span onClick={()=>{this.toCity()}}>西安</span>
               <input type="text" placeholder='搜索商品' onClick={()=>{this.toSearch()}}/> 
               <span onClick={()=>{this.login()}}>登录</span> 
            </div>
        );
    }
    async login (){
        this.props.history.push('/login');  
    }
    async toCity(){
        this.props.history.push('/city');
    }
}

export default withRouter(index);